<template>
    <div ref="el" style="border: 1px solid red;">
        Click Outside Of Me!
    </div>
</template>

<script setup>
import { ref } from 'vue';
import { onClickOutside } from '@vueuse/core';

const el = ref(null);

const close = () => {
    console.log('close');
};

onClickOutside(el, close);
</script>

<style lang="scss" scoped>

</style>